3.435 \(\int \cos ^4(c+d x) (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=61 \[ \frac{(a-b) \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac{(3 a+b) \sin (c+d x) \cos (c+d x)}{8 d}+\frac{1}{8} x (3 a+b) \]

[Out]

((3*a + b)*x)/8 + ((3*a + b)*Cos[c + d*x]*Sin[c + d*x])/(8*d) + ((a - b)*Cos[c + d*x]^3*Sin[c + d*x])/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0464012, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3675, 385, 199, 203} \[ \frac{(a-b) \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac{(3 a+b) \sin (c+d x) \cos (c+d x)}{8 d}+\frac{1}{8} x (3 a+b) \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4*(a + b*Tan[c + d*x]^2),x]

[Out]

((3*a + b)*x)/8 + ((3*a + b)*Cos[c + d*x]*Sin[c + d*x])/(8*d) + ((a - b)*Cos[c + d*x]^3*Sin[c + d*x])/(4*d)

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Simp[(x*(a + b*x^n)^(p + 1))/(a*n*(p + 1)), x] + Dist[(n*(p +
 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (In
tegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[p]
)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+b x^2}{\left (1+x^2\right )^3} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{(a-b) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac{(3 a+b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{4 d}\\ &=\frac{(3 a+b) \cos (c+d x) \sin (c+d x)}{8 d}+\frac{(a-b) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac{(3 a+b) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{8 d}\\ &=\frac{1}{8} (3 a+b) x+\frac{(3 a+b) \cos (c+d x) \sin (c+d x)}{8 d}+\frac{(a-b) \cos ^3(c+d x) \sin (c+d x)}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.12773, size = 46, normalized size = 0.75 \[ \frac{(a-b) \sin (4 (c+d x))+12 a (c+d x)+8 a \sin (2 (c+d x))+4 b d x}{32 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4*(a + b*Tan[c + d*x]^2),x]

[Out]

(4*b*d*x + 12*a*(c + d*x) + 8*a*Sin[2*(c + d*x)] + (a - b)*Sin[4*(c + d*x)])/(32*d)

________________________________________________________________________________________

Maple [A]  time = 0.082, size = 81, normalized size = 1.3 \begin{align*}{\frac{1}{d} \left ( b \left ( -{\frac{\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{4}}+{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{8}}+{\frac{dx}{8}}+{\frac{c}{8}} \right ) +a \left ({\frac{\sin \left ( dx+c \right ) }{4} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\cos \left ( dx+c \right ) }{2}} \right ) }+{\frac{3\,dx}{8}}+{\frac{3\,c}{8}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x)

[Out]

1/d*(b*(-1/4*sin(d*x+c)*cos(d*x+c)^3+1/8*cos(d*x+c)*sin(d*x+c)+1/8*d*x+1/8*c)+a*(1/4*(cos(d*x+c)^3+3/2*cos(d*x
+c))*sin(d*x+c)+3/8*d*x+3/8*c))

________________________________________________________________________________________

Maxima [A]  time = 1.6495, size = 93, normalized size = 1.52 \begin{align*} \frac{{\left (d x + c\right )}{\left (3 \, a + b\right )} + \frac{{\left (3 \, a + b\right )} \tan \left (d x + c\right )^{3} +{\left (5 \, a - b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/8*((d*x + c)*(3*a + b) + ((3*a + b)*tan(d*x + c)^3 + (5*a - b)*tan(d*x + c))/(tan(d*x + c)^4 + 2*tan(d*x + c
)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.68508, size = 122, normalized size = 2. \begin{align*} \frac{{\left (3 \, a + b\right )} d x +{\left (2 \,{\left (a - b\right )} \cos \left (d x + c\right )^{3} +{\left (3 \, a + b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/8*((3*a + b)*d*x + (2*(a - b)*cos(d*x + c)^3 + (3*a + b)*cos(d*x + c))*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*cos(c + d*x)**4, x)

________________________________________________________________________________________

Giac [B]  time = 4.16552, size = 2714, normalized size = 44.49 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/64*(3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*ta
n(c))*tan(d*x)^4*tan(c)^4 + 24*a*d*x*tan(d*x)^4*tan(c)^4 + 8*b*d*x*tan(d*x)^4*tan(c)^4 + 3*pi*b*sgn(-2*tan(d*x
)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 6*pi*b*sgn(2*tan(d*x)^2*tan(c)
^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 6*pi*b*s
gn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)
^2*tan(c)^4 + 6*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^4 - 6*b*arctan(-(tan(d*x
) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 + 48*a*d*x*tan(d*x)^4*tan(c)^2 + 16*b*d*x*tan(d*x)^4*ta
n(c)^2 + 6*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 +
48*a*d*x*tan(d*x)^2*tan(c)^4 + 16*b*d*x*tan(d*x)^2*tan(c)^4 + 6*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan
(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^4 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*t
an(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4 + 12*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-
2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 12*b*arctan((tan(d*x)
 + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^2 - 12*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1)
)*tan(d*x)^4*tan(c)^2 - 40*a*tan(d*x)^4*tan(c)^3 + 8*b*tan(d*x)^4*tan(c)^3 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2
- 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^4 + 12*b*arctan((tan(d*x)
+ tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^4 - 12*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))
*tan(d*x)^2*tan(c)^4 - 40*a*tan(d*x)^3*tan(c)^4 + 8*b*tan(d*x)^3*tan(c)^4 + 24*a*d*x*tan(d*x)^4 + 8*b*d*x*tan(
d*x)^4 + 3*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4 + 96*a*d*x*
tan(d*x)^2*tan(c)^2 + 32*b*d*x*tan(d*x)^2*tan(c)^2 + 12*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 +
2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 24*a*d*x*tan(c)^4 + 8*b*d*x*tan(c)^4 + 3*pi*b*sgn(-2*tan(d*x)^2*t
an(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^4 + 6*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*t
an(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2 + 6*b*arctan((tan(d*x) + tan(c))/(t
an(d*x)*tan(c) - 1))*tan(d*x)^4 - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4 - 24*a*tan
(d*x)^4*tan(c) - 8*b*tan(d*x)^4*tan(c) + 6*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*ta
n(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^2 + 24*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan
(d*x)^2*tan(c)^2 - 24*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 + 48*a*tan(d*x)
^3*tan(c)^2 - 48*b*tan(d*x)^3*tan(c)^2 + 48*a*tan(d*x)^2*tan(c)^3 - 48*b*tan(d*x)^2*tan(c)^3 + 6*b*arctan((tan
(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(c)^4 - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(c
)^4 - 24*a*tan(d*x)*tan(c)^4 - 8*b*tan(d*x)*tan(c)^4 + 48*a*d*x*tan(d*x)^2 + 16*b*d*x*tan(d*x)^2 + 6*pi*b*sgn(
-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2 + 48*a*d*x*tan(c)^2 + 16*b*d*x*
tan(c)^2 + 6*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^2 + 3*pi*b*sg
n(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c)) + 12*b*ar
ctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2 - 12*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c)
 + 1))*tan(d*x)^2 + 24*a*tan(d*x)^3 + 8*b*tan(d*x)^3 - 48*a*tan(d*x)^2*tan(c) + 48*b*tan(d*x)^2*tan(c) + 12*b*
arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(c)^2 - 12*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c)
 + 1))*tan(c)^2 - 48*a*tan(d*x)*tan(c)^2 + 48*b*tan(d*x)*tan(c)^2 + 24*a*tan(c)^3 + 8*b*tan(c)^3 + 24*a*d*x +
8*b*d*x + 3*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c)) + 6*b*arctan((tan(d*x
) + tan(c))/(tan(d*x)*tan(c) - 1)) - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1)) + 40*a*tan(d*x) -
8*b*tan(d*x) + 40*a*tan(c) - 8*b*tan(c))/(d*tan(d*x)^4*tan(c)^4 + 2*d*tan(d*x)^4*tan(c)^2 + 2*d*tan(d*x)^2*tan
(c)^4 + d*tan(d*x)^4 + 4*d*tan(d*x)^2*tan(c)^2 + d*tan(c)^4 + 2*d*tan(d*x)^2 + 2*d*tan(c)^2 + d)